package com.example.demo.util;

import javax.servlet.http.HttpServletResponse;

import com.example.demo.entity.base.ResponseBean;

public class ResponseBeanUtil {
	public static String MSG_Ok = "success";
	
	public static ResponseBean success(Object obj) {
		return new ResponseBean(HttpServletResponse.SC_OK, MSG_Ok, obj);
	}
	
	public static ResponseBean success(String msg,Object obj) {
		return new ResponseBean(HttpServletResponse.SC_OK, msg, obj);
	}
	
	public static ResponseBean success(int code,String msg,Object obj) {
		return new ResponseBean(code, msg, obj);
	}
	
	public static ResponseBean error(int code,String msg) {
		return new ResponseBean(code, msg , null);
	}
	
	public static ResponseBean error(String msg) {
		return new ResponseBean(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, msg, null);
	}
}
